<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Search Results</title>
        <link href="../styles/style.css" rel="stylesheet" type="text/css" /> 
        <link rel="icon" type="image/png" href="../images/dpicon.png" />
</head>

<body>
<%@ page import="java.util.*,controller.*, bean.*"%>
<%
	Integer cartItemCount = session.getAttribute("cartItemCount") != null 
										? (Integer)session.getAttribute("cartItemCount") : 0;
%>

<div id="page-wrap">
	<div id="profile-menu">
		<ul class="profile-menu-list">		
			<li><a href="#" title="user">${customer.screenName}</a></li>
			<li><a href="controller.AccountInformation" title="my account">my account</a></li>
			<li><a href="controller.Logout" title="login">logout</a></li>		
		</ul>
	</div><br/>
	
	<div id="main-menu">
		<!--<img src="devilpepperLogo.jpg" alt="devilpepper logo"/>-->
		<ul>
			<li><a href="controller.BookSearchForm" title="search">search</a></li>
			<li><a href="controller.SellBooksForm" title="sell books">sell books</a></li>
			<li><a href="controller.AboutForm" title="about">about</a></li>
			<li><a href="controller.ContactUsForm" title="contact us">contact us</a></li>
			<li class="cart"><a href="controller.CartForm" title="cart">cart&nbsp;&nbsp;<strong><%=cartItemCount%></strong></a></li>			
		</ul>		
	</div><br/>
	
	<div>
		<%
       		if(session.getAttribute("bookList")!= null)
       	   	{
       	   		HashMap<Integer, BookBean> bookList = (HashMap<Integer, BookBean>)session.getAttribute("bookList");       	   		       	   				
       	       	for(BookBean book: bookList.values()) {
        %>	
        <form action="controller.ShoppingCart" method="post">
        <!-- <form action="./cart"  method="post"> -->
	        <div class="search-box1">
	        <input type="hidden" name="bookId" value =<%= book.getBookId()%> ></input> 
	        <ul>
	        	<li><strong>Title:</strong>&nbsp;<%= book.getTitle()%></li>
	         	<li><strong>ISBN:</strong>&nbsp;<%= book.getIsbn()%></li> 
	         	<li><strong>Author:</strong>&nbsp;<%=book.getAuthorFirstName()%>&nbsp;<%=book.getAuthorLastName()%></li>           		
	         	<li><strong>Description:</strong>&nbsp;<%= book.getDescription()%></li>
	        </ul>        
	        <div class="search-line"></div>             	
	       	</div>       	
	       	<div class="search-box2">
	    		<button type="submit">Add To Cart</button><br/><br/>
	     		<strong>Price: </strong>&nbsp;<%= book.getPrice()%>          		          		           		
	       	</div>
       	</form>
       	   	
       	<% }} else {%>
       	<div class="search-box1">
       	<h2>Sorry! No book results found!</h2>
       	</div>
       	<% }%>        
	</div>
</div>
<div class="footer_container">
	&copy;2011 All Rights Reserved
	<a href="mailto:devilpepper@hotmail.com">Devilpepper</a>
</div>

</body>
</html>
